<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\common\model\Course as CourseModel;
use app\common\model\user\Favorite;

/**
 * 首页接口
 */
class Notice extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public function list()
    {
        $model = new \app\common\model\Notice();
        $list = $model->order(['is_top_switch' => 'desc', 'updatetime' => 'desc'])->select();
        $this->success('', $list);
    }

    public function info()
    {
        $id = $this->request->get('id', 0);
        $model = new \app\common\model\Notice();
        $info = $model->find($id);
        $this->success('', $info);
    }
}
